﻿using System;
using TMPro;
using UnityEngine;

public class TMPRenderQueue : MonoBehaviour
{
    [SerializeField] private int renderQueue;
    private TMP_Text tmp;
    private int currentRenderQueue;
    private void Awake()
    {
        tmp = GetComponent<TMP_Text>();
        
    }

    private void Update()
    {
        if (tmp != null && currentRenderQueue !=renderQueue )
        {
            currentRenderQueue = renderQueue;
            tmp.fontMaterial.renderQueue = currentRenderQueue;
        }
            
    }
}
